package com.starsea.book.ui.newpage.weidget.banner

import android.view.View

/**
 * 描述:
 */
abstract class OnNoDoubleClickListener : View.OnClickListener {
  private var mThrottleFirstTime = 1000
  private var mLastClickTime: Long = 0

  constructor()
  constructor(throttleFirstTime: Int) {
    mThrottleFirstTime = throttleFirstTime
  }

  override fun onClick(v: View) {
    val currentTime = System.currentTimeMillis()
    if (currentTime - mLastClickTime > mThrottleFirstTime) {
      mLastClickTime = currentTime
      onNoDoubleClick(v)
    }
  }

  abstract fun onNoDoubleClick(v: View?)
}
